package com.bishe.cyh.controller;

import com.bishe.cyh.mode.Result;
import com.bishe.cyh.mode.TaskSubmit;
import com.bishe.cyh.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: Poppin
 * @Date: 2022/3/2 15:12
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api")
public class TaskController {

    private TaskService taskService;

    @Autowired
    public void setTaskController(TaskService taskService){
        this.taskService = taskService;
    }

    @PostMapping("/submittask")
    public Result TaskSubmit(@RequestBody TaskSubmit taskSubmit){
        return taskService.TaskSubmit(taskSubmit);
    }

    @GetMapping("/choice")
    public Result GetChoice(){
        return taskService.Datachoice();
    }

    @GetMapping("/TaskList")
    public Result GettaskList(){
        return taskService.GetTaskList();
    }

    @GetMapping("/taskdelete")
    public Result D(@RequestParam("jgid")String jgid){
        return taskService.DeleteTask(jgid);
    }
}
